# 画饼图
import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif']=['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False    # 用来正常显示负号

labels='frogs','hogs','狗','logs'            # 配置标签
sizes=15,20,45,10                       # 配置标签值大小
colors='yellowgreen','gold','lightskyblue','lightcoral' # 配置标签颜色
explode=0,0.1,0,0                       # 配置饼图间隔
plt.pie(sizes,explode=explode,labels=labels,colors=colors,autopct='%1.1f%%',shadow=True,startangle=50)
plt.axis('equal')
plt.show()